<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div></div>
  <!-- 创建一个函数alphabetPosition，它的作用是将一个字符串里所有的字母（不区分大小写）都转成数字的字符串

如 "a" = 1, "b" = 2, ... "z" = 26

如果该字符不是英文字母，则忽略该字符

比如：alphabetPosition("The sunset sets at twelve o' clock.")

返回值是："20 8 5 19 21 14 19 5 20 19 5 20 19 1 20 20 23 5 12 22 5 15 3 12 15 3 11" -->

<script>

  function alphabetPosition(str){
    return [...str.replace(/[^a-zA-Z]/g, '').toLowerCase()].map(c=>c.charCodeAt(0)-'a'.charCodeAt(0)+1).join(' ')}
  console.log(alphabetPosition("The sunset sets at twelve o' clock."))  
</script>
</script>
</body>
</html>